package com.tarena.lbs.business.config;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class BusinessMetaObjectHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        this.strictInsertFill(metaObject, "entryTime", Date.class, new Date());
        this.strictInsertFill(metaObject, "businessStatus", Integer.class, 1);
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        // 更新时不自动填充
    }
}
